import pprint

import requests

# requests请求支持这五种HTTP请求方法
# requests.get()
# requests.post()
# requests.patch()
# requests.put()
# requests.delete()


url = 'http://127.0.0.1:8000/v1/task/cmd/'
data = {
    'InstanceId':'i-2zeja6ic019xt20vj1z9',
    'command':'me',
}
response = requests.post(url,data)
# print(response.text)   # 返回字符串
# print(response.content) # 返回bytes
# print(response.status_code)  # 响应状态码， 200
pprint.pprint(response.json())  # 返回python对象
